{template header}


{template sidebar}

<!-- artile begin -->
<div class="article">
{template title}





<!--{if  $type == 'inStock'}-->
<!--{if  $a == 'index' || $a == 'search_inStock'}-->
<form class="form-search" action="{$this->url($c, 'search_inStock', $this->get())}">
    <table>
        <tr><td class="td1" width="20%">入库单号：</td>
            <td>

                <div class="input-append">

                    <input type="text" name="key" class="span2 search-query" id="stockNo"  placeholder="请输入旺旺ID" />
                    <button type="button" class="btn search">搜索</button>
                    <td>
                    <button type="button" onclick="totalInStock()">入库汇总</button></td>
                </div>
            </td >
        </tr>
    </table>

</form>
<!--{/if}-->
    <script >
        function  totalInStock()
        {
            var url = "{$this->url('totalStock', 'lookTotalStock',array('inOutStockType'=>0))}";
            url = url + "&inOutStockNo="+ window.document.getElementById("stockNo").value;
            //window.location.href = url;
            window.open(url);
        }
        </script>


<table cellpadding="1" cellspacing="1" width="100%" border="0">
    <!--{if  $a == 'index' || $a == 'search_inStock'}-->
    <tr>
        <th width="10%">入库单号</th>
        <th width="10%">操作员</th>
        <th width="10%">入库日期</th>
        <th width="10%">商品品种总数</th>
        <th width="15%">供应商名称</th>
        <th width="10%">操作</th>

    </tr>

    <!--{if $result}-->
    <!--{loop $result $val}-->
    <tr>
        <td>{$val['inOutStockNo']}</td>
        <td>{$val['operator']}</td>
        <td>{$val['inOutStockDate']}</td>
        <td>{$val['amount']}</td>
        <td>{$val['name']}</td>
        <td class="operate">
            <a href="{$this->url($c,'edit',array('inOutStockNo'=>$val['inOutStockNo'], 'type'=>'inStock'))}">编辑</a>
            <a title="删除商品" class="del" href="{$this->url($c,'del',array('inOutStockNo'=>$val['inOutStockNo']))}">删除</a>
        </td>
    </tr>
    <!--{/loop}-->
    <!--{else}-->
    <tr>
        <td colspan="5">没有数据记录！</td>
    </tr>
    <!--{/if}-->
    <tr>
        <td colspan="4" class="td4">
            <a title="添加入库单" class="btn btn-success " href="{$this->url('inStock','addOrder',array('type' => $type))}">添加入库单</a>
        </td>
    </tr>
    <!--{/if}-->


    <!--{if  $a == 'lookGoods' || $a == 'search_Goods'}-->


    <tr>
        <td><input type="checkbox" name="id"  width="5%" value="{$t['Name']}" /></td>
        <th width="30%">商品编号</th>
        <th width="15%">数量</th>
        <th width="15%">颜色信息</th>
        <th width="15%" >尺码信息</th>
        <th width="20%">操作</th>
    </tr>



    <!--{if $result}-->
    <!--{loop $result $val}-->
    <tr>
        <td><input type="checkbox" name="id" width="5%" value="{$val['id']}" /></td>
        <td>{$val['goodsNo']}</td>
        <td>{$val['goodsNumber']}</td>
        <td>{$val['color']}</td>
        <td>{$val['size']}</td>
        <td class="operate">
            <a href="{$this->url($c,'editGoods',array('id'=>$val['id'], 'type'=>'inStock'))}">编辑</a>
            <a title="删除商品" class="del" href="{$this->url($c,'del',array('id'=>$val['id']))}">删除</a>
        </td>
    </tr>
    <!--{/loop}-->
    <!--{else}-->
    <tr>
        <td colspan="5">没有数据记录！</td>
    </tr>
    <!--{/if}-->
    <!--{if $pager}-->
    <!--分页开始-->
    <tr>
        <td colspan="6">
            <div class="page">{$pager}</div>
        </td>
    </tr>
    <!--分页结束-->
    <!--{/if}-->
    <!--{/if}-->






</table>

<!--{/if}-->




<!--{if  $a == 'addOrder' ||  $a =='edit' }-->
<form method="post" action="{$this->url($c, 'save', array('inOutStockNo' => $result['inOutStockNo'],'type' => $type) )}">
    <table cellpadding="1" cellspacing="1" width="100%" border="0">

        <tr>

            <td class="td1">入库单号：</td>

            <td class="td2" colspan="2">
                <input type="text" size="30" name="orderNo" value="{$a == 'edit' ? $result['inOutStockNo'] : ''}" />
            </td>

        </tr>
        <tr>
            <td class="td1">库存名称：</td>
            <td class="td2" colspan="2">
                <select name="stockNo"   >
                    <!--{loop $res  $val}-->
                    <option value="{$val['stockNo']}" {echo $result['stockNo']  == $val['stockNo'] ? selected : ''}  />{$val['stockName']}</option>
                    <!--{/loop}-->
                </select>
            </td>
        </tr>

        <tr>
            <td class="td1">供货商名称：</td>
            <td class="td2" colspan="4">
                <select name="supplierId"   >
                    <!--{loop $res1  $val}-->
                    <option value="{$val['id']}" {echo $result['supplierId']  == $val['id'] ? selected : ''}  />{$val['name']}</option>
                    <!--{/loop}-->
                </select>
            </td>
        </tr>

        <tr>
            <td class="td1">商品总数：</td>
            <td class="td2" colspan="4">
                <input type="text" name="totalNum" value="{$a == 'edit' ? $result['amount'] : ''}" />
            </td>
        </tr>
        <tr>
            <td class="td1">运费价格</td>
            <td class="td2" colspan="4">
                <input type="text" name="logisticCost" value="{$a == 'edit' ? $result['logisticCost'] : ''}" />
            </td>
        </tr>

        <tr>
            <th colspan="2" class="td4">
                <a title="保存供货商" class="btn btn-success save" href="{$this->url($c)}">保 存</a>
            </th>
        </tr>



    </table>
</form>
<!--{/if}-->








</div>
<!-- artile end -->
{template footer}
